  
<div align="center">
  <h1>ตารางกรอกข้อมูลคุณภาพ MasterReel</h1>
</div>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="font">
  <tr>
    <td width="8%" height="40">ประเภท</td>
    <td width="26%" height="40"> :
      <select class="select" id="ticket1">
        <option value="Reel">Reel</option>
        <option value="Winder">Winder</option>
      </select></td>
    <td width="8%" height="40">Reel No.</td>
    <td width="25%" height="40"> :
      <input name="textfield" type="text" class="k-textbox" id="reelNo"/></td>
    <td width="8%" height="40">Date</td>
    <td width="25%" height="40"> :
      <input id="datepicker" data-bind="value: departure" /></td>
  </tr>
  <tr>
    <td height="40">Type</td>
    <td height="40"> :
      <select class="select" id="ticket2">
        <option value="PPC PMW">PPC PMW</option>
        <option value="LPP">LPP</option>
        <option value="OSP PRO-NEW">OSP PRO-NEW</option>
      </select></td>
    <td height="40">Grade</td>
    <td height="40"> :
      <select class="select" id="ticket4">
        <option value="A">A</option>
        <option value="H">H</option>
        <option value="R">R</option>
      </select></td>
    <td height="40">Shift</td>
    <td height="40"> :
      <select class="select" id="ticket5">
        <option value="A">A</option>
        <option value="B">B</option>
        <option value="C">C</option>
      </select></td>
  </tr>
  <tr>
    <td height="40">Gram </td>
    <td height="40"> :
      <select class="select" id="ticket3">
        <option value="60">60</option>
        <option value="64">64</option>
        <option value="70">70</option>
        <option value="75">75</option>
        <option value="80">80</option>
        <option value="90">90</option>
        <option value="100">100</option>
      </select></td>
    <td height="40">Problem</td>
    <td height="40"> :
      <input type="text" name="textfield3" id="problem" class="k-textbox"/></td>
    <td height="40">Time</td>
    <td height="40"> :
      <input type="text" name="textfield2" id="timepicker" /></td>
  </tr>
</table>
<br />
<table width="99%" align="center">
  <tr>
    <td><div align="right"> <span id="loading"></span>
        <input name="Submit" id="submit" type="submit" class="k-button" value="บันทึกข้อมูล"/>
        &nbsp;
        <input name="Reset" type="reset" class="k-button" value="ยกเลิก"/>
      </div></td>
  </tr>
</table>
<table width="99%" align="center" class="font">
  <tr>
    <td><table id="grid">
        <thead>
          <tr>
            <th data-field="rank">Properties Item</th>
            <th data-field="rating">Value</th>
            <th data-field="title">Unit</th>
            <th data-field="year">Properties Item</th>
            <th data-field="dse">Value</th>
            <th data-field="asa">Unit</th>
            <th data-field="aa">Properties Item</th>
            <th data-field="bb">Value</th>
            <th data-field="cc">Unit</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>น้ำหนักม้วน</td>
            <td><input name="mr10_1" id="mr10_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>Tons ตัน</td>
            <td>Water Absorp TS</td>
            <td><input name="mr32_1" id="mr32_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>(g/m<sup>2</sup>)</td>
            <td>Internal Bonding</td>
            <td><input name="mr53_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>(J/m<sup>2</sup>)</td>
          </tr>
          <tr>
            <td>Basis Weight</td>
            <td><input name="mr11_1" id="mr11_1"type="number" class="k-textbox number" value="0"   /></td>
            <td>(g/m<sup>2</sup>)</td>
            <td>Water Absorp BS</td>
            <td><input  name="mr33_1" id="mr33_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>(g/m<sup>2</sup>)</td>
            <td>Friction static</td>
            <td><input  name="mr54_1" id="mr54_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td></td>
          </tr>
          <tr>
            <td>Thickness</td>
            <td><input name="mr12_1" id="mr12_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>(mm)</td>
            <td>PPF Value</td>
            <td><input name="mr34_1" id="mr34_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>(PPF)</td>
            <td>Friction kinetic</td>
            <td><input name="mr55_1" id="mr55_1" type="number" class="k-textbox number" value="0"   /></td>
            <td></td>
          </tr>
          <tr>
            <td>Density</td>
            <td><input  name="mr13_1" id="mr13_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>(g/cm<sup>3</sup>)</td>
            <td>Filler</td>
            <td><input name="mr35_1" id="mr35_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>(%)</td>
            <td>Raggesness</td>
            <td><input name="mr56_1" id="mr56_1" type="number" class="k-textbox number" value="0"  /></td>
            <td>Plattern No.</td>
          </tr>
          <tr>
            <td>Bulk</td>
            <td><input name="mr14_1" id="mr14_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>(cm<sup>3</sup>/g)</td>
            <td>Moisture</td>
            <td><input name="mr36_1" id="mr36_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>(%)</td>
            <td>Black density</td>
            <td><input name="mr57_1" id="mr57_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>Plattern No.</td>
          </tr>
          <tr>
            <td>Roughness (TS)</td>
            <td><input  name="mr15_1" id="mr15_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>ml/min</td>
            <td>CIE Whiteness</td>
            <td><input name="mr37_1" id="mr37_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>(%)</td>
            <td>Gainniness</td>
            <td><input name="mr58_1" id="mr58_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>Plattern No.</td>
          </tr>
          <tr>
            <td>Roughness (BS)</td>
            <td><input name="mr16_1" id="mr16_1" type="number" class="k-textbox number" value="0"  /></td>
            <td>ml/min</td>
            <td>ISO Brightness</td>
            <td><input  name="mr38_1" id="mr38_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>(%)</td>
            <td>Flat Curl Before</td>
            <td><input name="mr59_1" id="mr59_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>mm</td>
          </tr>
          <tr>
            <td>Porosity</td>
            <td><input name="mr17_1" id="mr17_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>(s./100)</td>
            <td>Opacity</td>
            <td><input  name="mr39_1" id="mr39_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>(m<sup>2</sup>/kg)</td>
            <td>Flat Curl After F</td>
            <td><input name="mr60_1" id="mr60_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>mm</td>
          </tr>
          <tr>
            <td>Air Permeability</td>
            <td><input name="mr18_1" id="mr18_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>ml/min</td>
            <td>Scatter Co.</td>
            <td><input  name="mr40_1" id="mr40_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>(m<sup>2</sup>/kg)</td>
            <td>Flat Curl After W</td>
            <td><input name="mr61_1" id="mr61_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>mm</td>
          </tr>
          <tr>
            <td>Tensile Strenght MD</td>
            <td><input  name="mr19_1" id="mr19_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>(kN/m)</td>
            <td>Absorb Co.</td>
            <td><input  name="mr41_1" id="mr41_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>&nbsp;</td>
            <td>Flat Curl After F-W</td>
            <td><input name="mr62_1" id="mr62_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>Double mm</td>
          </tr>
          <tr>
            <td>Tensile Strenght CD</td>
            <td><input name="mr20_1" id="mr20_1" type="number" class="k-textbox number" value="0"  /></td>
            <td>(kN/m)</td>
            <td>L*</td>
            <td><input  name="mr42_1" id="mr42_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td></td>
            <td>Flat Curl After W-F</td>
            <td><input  name="mr63_1" id="mr63_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>Double mm</td>
          </tr>
          <tr>
            <td>Tensile Stretch MD</td>
            <td><input  name="mr21_1" id="mr21_1"  type="number" class="k-textbox number" value="0"  /></td>
            <td>(%)</td>
            <td>a*</td>
            <td><input  name="mr43_1" id="mr43_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td></td>
            <td>Hanging Curl Before </td>
            <td><input name="mr64_1" id="mr64_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>mm</td>
          </tr>
          <tr>
            <td>Tensile Stretch CD</td>
            <td><input name="mr22_1" id="mr22_1" type="number" class="k-textbox number" value="0"  /></td>
            <td>(%)</td>
            <td>b*</td>
            <td><input  name="mr44_1" id="mr44_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td></td>
            <td>Hanging Curl After F</td>
            <td><input  name="mr65_1" id="mr65_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>mm</td>
          </tr>
          <tr>
            <td>Tensile Index</td>
            <td><input name="mr23_1" id="mr23_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>Nm/g</td>
            <td>Dirt</td>
            <td><input  name="mr45_1" id="mr45_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>(ppm)</td>
            <td>Hanging Curl After W</td>
            <td><input  name="mr66_1" id="mr66_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>mm</td>
          </tr>
          <tr>
            <td>Tear MD</td>
            <td><input name="mr24_1" id="mr24_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>(mN)</td>
            <td>Pen Writing Top</td>
            <td><input  name="mr46_1" id="mr46_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>Plattern No.</td>
            <td>Hanging Curl After F-W</td>
            <td><input name="mr67_1" id="mr67_1" type="number" class="k-textbox number" value="0"  /></td>
            <td>Double mm</td>
          </tr>
          <tr>
            <td>Tear CD</td>
            <td><input name="mr25_1" id="mr25_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>(mN)</td>
            <td>Pen Writing Bottom</td>
            <td><input name="mr47_1" id="mr47_1" type="number" class="k-textbox number" value="0"  /></td>
            <td>Plattern No.</td>
            <td>Hanging Curl After W-F</td>
            <td><input name="mr68_1" id="mr68_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>Double mm</td>
          </tr>
          <tr>
            <td>Bending Stiffness MD</td>
            <td><input name="mr26_1" id="mr26_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>(mN)</td>
            <td>Stockigt Top</td>
            <td><input name="mr48_1" id="mr48_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>Second.</td>
            <td>2 Sigma Basis Weight</td>
            <td><input name="mr69_1" id="mr69_1" type="number" class="k-textbox number" value="0"   /></td>
            <td></td>
          </tr>
          <tr>
            <td>Bending Stiffness CD</td>
            <td><input name="mr27_1" id="mr27_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>(mN)</td>
            <td>Stockigt Bottom</td>
            <td><input name="mr49_1" id="mr49_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td>Second.</td>
            <td>2 Sigma Thicknes</td>
            <td><input  name="mr70_1" id="mr70_1"  type="number" class="k-textbox number" value="0"   /></td>
            <td></td>
          </tr>
          <tr>
            <td>Bursting Strength</td>
            <td><input  name="mr28_1" id="mr28_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>(kPa)</td>
            <td>TSAmd</td>
            <td><input name="mr50_1" id="mr50_1" type="number" class="k-textbox number" value="0"   /></td>
            <td></td>
            <td>2 Sigma DE</td>
            <td><input name="mr71_1" id="mr71_1" type="number" class="k-textbox number" value="0"   /></td>
            <td></td>
          </tr>
          <tr>
            <td>Surface Strength TS</td>
            <td><input name="mr29_1" id="mr29_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>(No.A)</td>
            <td>TSImd</td>
            <td><input name="mr51_1" id="mr51_1" type="number" class="k-textbox number" value="0"   /></td>
            <td></td>
            <td>2 Sigma Filler</td>
            <td><input  name="mr72_1" id="mr72_1" type="number" class="k-textbox number" value="0"   /></td>
            <td></td>
          </tr>
          <tr>
            <td>Surface Strength BS</td>
            <td><input name="mr30_1" id="mr30_1" type="number" class="k-textbox number" value="0"   /></td>
            <td>(No.A)</td>
            <td>TSIcd</td>
            <td><input  name="mr52_1" id="mr52_1" type="number" class="k-textbox number" value="0"   /></td>
            <td></td>
            <td>2 Sigma Moisture</td>
            <td><input name="mr73_1" id="mr73_1" type="number" class="k-textbox number" value="0"   /></td>
            <td></td>
          </tr>
          <tr>
            <td>Suf. Electric</td>
            <td><input  name="mr31_1" id="mr31_1" type="number" class="k-textbox number" value="0"    /></td>
            <td>(Ohm)</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
          </tr>
        </tbody>
      </table></td>
  </tr>
</table>

<!--scrip list select--> 
<script>
                $(document).ready(function() {
                    var viewModel = {
                        chosenTicket: ko.observable(),
                        resetTicket: function() { this.chosenTicket(null) },
                    };
                    $("#ticket1").kendoDropDownList().trigger("change");
                    $("#ticket2").kendoDropDownList().trigger("change");
                    $("#ticket3").kendoDropDownList().trigger("change");
                    $("#ticket4").kendoDropDownList().trigger("change");
                    $("#ticket5").kendoDropDownList().trigger("change");
                    var today = new Date(),
                        birthdays = [
                           +new Date(today.getFullYear(), today.getMonth(), 11),
                           +new Date(today.getFullYear(), today.getMonth() + 1, 6),
                           +new Date(today.getFullYear(), today.getMonth() + 1, 27),
                           +new Date(today.getFullYear(), today.getMonth() - 1, 3),
                           +new Date(today.getFullYear(), today.getMonth() - 2, 22)
                        ];
                    $("#grid").kendoGrid({
						columns: [
						{ field: "rank", width: "40px" },
						{ field: "rating", width: "15px" },
						{ field: "title",  width: "20px" },
						{ field: "year", width: "40px" },
						{ field: "dse", width: "15px" },
						{ field: "asa", width: "20px" },
						{ field: "aa", width: "40px" },
						{ field: "bb", width: "15px" },
						{ field: "cc", width: "20px" }

						],
                        //height: 1000,
						//pageable: true,
						dataSource: {
						//pageSize: 12
						} 
                    });
                    
                    $("#datepicker").kendoDatePicker({
                    	 format:"yyyy-MM-dd",
                         value: today ,
                        footer: "Today - #=kendo.toString(data, 'd') #"
                    });

                    $("#datepicker").data("kendoDatePicker")
                                    .dateView.calendar.element
                                    .width(200);
                    $("#timepicker").kendoTimePicker();
                    $("#submit").click(function(){
                        var masterMR1 = $("#ticket1").val(); // ประเภท
                        var masterMR2 = $("#ticket2").val();  //type
                        var masterMR3 = $("#datepicker").val(); //date
                        var masterMR4 = $("#ticket3").val(); //gram
                        var masterMR5 = $("#ticket4").val();  //grade
                        var masterMR6 = $("#ticket5").val(); //shift
                        var masterMR7 = $("#reelNo").val();  //reel
                        var masterMR8 = $("#problem").val();  //reel
                        <?php 
                             	for($i=10;$i<=73;$i++){
                             		
                             	echo "var masterMR".$i."_1 = $(\"#mr".$i."_1\").val(); \n";
                             //	echo "var masterMR".$i."_2 = $(\"#mr".$i."_2\").val(); \n";	
                             	}
                             ?>                
                             var loading = "<center><img src='<?=base_url(); ?>css/BlueOpal/loading-image.gif?>'></center>"
                    	//alert('ไม่มีชื่อผู้ใช้...กรุณาตรวจสอบใหม่อีกครั้ง'+masterMR1+' '+masterMR2+' '+masterMR3+' '+masterMR4+' '+masterMR5+' '+masterMR6);
                            	 if (confirm("ต้องการจะบันทึกข้อมูลหรือไม่ ?")) 
                                 {                              	
			                    	$.ajax({
			        					url : "<?php echo base_url();?>index.php/masterreel/getDataMasterReel",
			        					type: "POST",
			        					data:({ 	
					        						masterMR2 : masterMR2,
					        						masterMR3 : masterMR3,
					        						masterMR4 : masterMR4,
					        						masterMR5 : masterMR5,
					        						masterMR6 : masterMR6,
					        						masterMR7 : masterMR7,
					        						masterMR8 : masterMR8,
					        						 <?php 
					        		                         	for($i=10;$i<=73;$i++){
					        		                         		
					        		                         	echo "masterMR".$i."_1 : masterMR".$i."_1, \n";
					        		                         //	echo "masterMR".$i."_2 : masterMR".$i."_2, \n";
					        		                         	}
					        		                 ?>
					        		                 masterMR1 : masterMR1
			        						}),
			        						beforeSend : function(){
			    								$("#loading").html(loading);
			    								//$("#submit").attr("disabled","disabled");
											},
			        					success : function(rs){
			            						alert(rs);
			            						$("#loading").html('');
			            					 	//$("#submit").removeAttr("disabled","disabled");
			            					 	 <?php 
			            		                         	for($i=10;$i<=73;$i++){
			            		                         		echo " $(\"#mr".$i."_1\").val('0'); \n";
			            		                         	//	echo "  $(\"#mr".$i."_2\").val('0'); \n";	
			            		                         	}
			            		                 ?> 
			        						 
			        					}			
			        				});
                                 };
                    });
                });
            </script> 
